import request from '@/utils/request'

/*
*获取司机分页数据的接口
*  */
export const fetchChauffeurAPI = (params) => {
  return request({
    url: '/manager/driver/page',
    method: 'GET',
    params
  })
}

/*
*
* 获取司机基本信息详情的接口
*  */
export const fetchChauffeurDetailAPI = (id) => {
  return request({
    url: `/manager/driver/${id}`,
    method: 'GET'
  })
}

/*
*
* 获取所有车辆的接口
*  */
export const fetchVehicleAllAPI = () => {
  return request({
    url: '/manager/truck/page',
    method: 'GET',
    params: {
      page: 1,
      pageSize: 100
    }
  })
}

/*
* 司机安排车辆的接口
*  */
export const bindVehicleAPI=(data)=>{
  return request({
    url:"/manager/driver/truckDrivers",
    method:"POST",
    data
  })
}

/*
* 保存司机信息的接口
*  */
export const saveChauffeurAPI=(data)=>{
  return request({
    url:`/manager/driver/${data.userId}`,
    method:"PUT",
    data
  })
}

/*
*
* 获取司机驾驶证信息的接口
*  */
export const fetchLicenseInfoAPI=(id)=>{
  return request({
    url:`/manager/driverLicense/${id}`,
    method:"GET",
  })
}

/*
* 保存司机驾驶证信息的接口
*  */
export const saveLicenseInfoAPI=(data)=>{
  return request({
    url:"/manager/driverLicense",
    method:"POST",
    data
  })
}

